//
//  Forum.m
//  CarFace
//
//  Created by dlios on 15-3-24.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "Forum.h"

@implementation Forum
- (void)dealloc
{
    //    首页
    [_smallpic release];
    [_title release];
    [_bbsname release];
    [_replycounts release];
    
    [_lastreplydate release];
    [_postusername release];
    [_bbsid release];
//    详情
    [_topicid release];
    [_rowcount release];
    [super dealloc];
}

- (instancetype)initWithDictionary:(NSDictionary *)dic
{
    self = [super initWithDictionary:dic];
    if (self) {
        //    首页|常用论坛里面的主题论坛
        self.smallpic = [dic objectForKey:@"smallpic"];
        self.title = [dic objectForKey:@"title"];
        self.bbsname = [dic objectForKey:@"bbsname"];
        
//        self.replycounts = [dic objectForKey:@"replycounts"];
        
        NSNumber *number0 = [dic objectForKey:@"replycounts"];
        NSNumberFormatter *format1 = [[NSNumberFormatter alloc]init];
        self.replycounts = [format1 stringFromNumber:number0];
        [format1 release];
        
//    详情
       NSNumber *number = [dic objectForKey:@"topicid"];
       NSNumberFormatter *format = [[NSNumberFormatter alloc] init];
       self.topicid = [format stringFromNumber:number];
       [format release];
        
        self.lastreplydate = [dic objectForKey:@"lastreplydate"];
        self.postusername = [dic objectForKey:@"postusername"];
        
        
        NSNumber *number3 = [dic objectForKey:@"bbsid"];
        NSNumberFormatter *format3 = [[NSNumberFormatter alloc] init];
        self.bbsid = [format3 stringFromNumber:number3];
        [format3 release];
    
        self.rowcount = [dic objectForKey:@"rowcount"];
     
    }
    
    return self;
    
}


@end
